package com.developer.platform.application.query.assembler;

import cn.hutool.core.bean.BeanUtil;
import com.developer.platform.application.query.dto.SystemDto;
import com.developer.platform.domain.Systems;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.stereotype.Component;

/**
 * @author ：qiaoliang
 * @date ：2020-12-29
 */
@Component
public class SystemAssembler extends BaseAssembler {

  public List<SystemDto> toSystemDto(List<Systems> list){
    List<SystemDto> collect = list.stream().map(l -> {
      SystemDto systemDto = new SystemDto();
      BeanUtil.copyProperties(l, systemDto);
      return systemDto;
    }).collect(Collectors.toList());
    this.userName(collect);
    return collect;
  }

}
